﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CRUD
{
    public class Person
    {
        public int id { get; set; }
        public string FName { get; set; }
        public string LName { get; set; }
        public int Age { get; set; }
        public string SaveToSCV()
        {
            string str = id.ToString() + ";" + FName.ToString() + ";"
                + LName.ToString() + ";" + Age.ToString();

            return str;
        }
        public void LoadFromDB(object[] obj)
        {
            id = Convert.ToInt32(obj[0]);
            FName = obj[1].ToString();
            LName = obj[2].ToString();
            Age = Convert.ToInt32(obj[3]);
        }
        public void LoadFromCSV(string[] strArray)
        {
            id = Convert.ToInt32(strArray[0]);
            FName = strArray[1];
            LName = strArray[2];
            Age = Convert.ToInt32(strArray[3]);
        }
    }
}
